﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.Reporting.WinForms;

namespace Worktool
{
    public partial class ReportRooms : Form
    {
        public ReportRooms()
        {
            InitializeComponent();
            this.Text = "Rooms: " + Properties.Settings.Default.CurrentDBName; 
        }

        private void ReportRooms_Load(object sender, EventArgs e)
        {
            this.sTAMMDATEN_areasTableAdapter.Fill(this.aSCDataSet.STAMMDATEN_areas);
            this.vw_rep_RoomsTableAdapter.Fill(this.aSCDataSet.vw_rep_Rooms);
            this.reportViewer1.RefreshReport();
        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            
            try
            {
                ReportParameter[] parameters = new ReportParameter[1];
                parameters[0] = new ReportParameter("uberschrift", comboBox1.Text);
                this.reportViewer1.LocalReport.SetParameters(parameters);
                vwrepRoomsBindingSource.Filter = string.Format("Venue LIKE '{0}'", (comboBox1.SelectedValue.ToString()));
                this.reportViewer1.RefreshReport();
            }
            catch (Exception ex)
            {
            }
        }
    }
}
